/*
 * @Author: your name
 * @Date: 2021-04-20 18:29:37
 * @LastEditTime: 2021-04-26 18:17:18
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \api\lib\main.dart
 */
// import 'package:api/pages/animatedalignapi.dart';
// import 'package:api/pages/scrollphysicsapi.dart';
// import 'package:api/pages/animatedcontainerapi.dart';
// import 'package:api/pages/animatedcrossfadeapi.dart';
// import 'package:api/pages/animationdemo.dart';
// import 'package:api/pages/animatediconapi.dart';
// import 'package:api/pages/animatedlistdemo.dart';
// import 'package:api/pages/Animatedmodalbarrierdemo.dart';
// import 'package:api/pages/animatedopacitydemo.dart';
// import 'package:api/pages/animatedpaddingdemo.dart';
// import 'package:api/pages/animatedphysicalmodeldemo.dart';
// import 'package:api/pages/animatedpositioneddemo.dart';

// import 'package:api/pages/animatedpositiondirectionaldemo.dart';
// import 'package:api/pages/animatedSizeDemo.dart';
// import 'package:api/pages/animatedswitcherdemo.dart';
// import 'package:api/pages/appbardemo.dart';
// import 'package:api/pages/icondemo.dart';
// import 'package:api/pages/backdrapfilterdemo.dart';
// import 'package:api/pages/bannerdemo.dart';
// import 'package:api/pages/baselinedemo.dart';
// import 'package:api/pages/raisebutton.dart';
// import 'package:api/pages/raisebuttondemo.dart';
import 'package:api/pages/apis/routers/error_page.dart';
import 'package:api/pages/apis/routers/first_page.dart';
import 'package:api/pages/apis/routers/my_navgator_observers.dart';
import 'package:api/pages/apis/routers/second_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

void main() => runApp(MaterialApp(
      // home: AnimatedContainerApi(),
      // home: AnimatedCrossFadeApi()
      // home: AnimationDemo()
      // home: AnimatedIconApi()
      // home: AnimatedListDemo()
      // home: AnimatedModalBarrierDemo()
      // home: AnimatedOpacityDemo()
      // 2021.04.24 学习记录
      // home: AnimatedPaddingDemo()
      // home: AnimatedPhysicalModelDemo()
      // home: AnimatedPositionedDemo()
      // home: AnimatedPositionDirectionalDemo()
      // 2021.04.25 学习记录
      // home: AnimatedSizeDemo()
      // home: AnimatedSwitcherDemo()
      // home: AppBarDemo()
      // 2021.04.26 学习记录
      // home: IconDemo()
      // home: RaiseButtonDemo(),
      // 2021.04.28 学习记录
      // home: BackdrapFileterDemo(),
      // home: BannerDemo(),
      // home: BaselineDemo(),
      // home: RaiseButtonDemo(),
      // home: RaiseButtonDemo1(),
      // 在android 最近任务视图中起作用，在ios 不起作用
      // 在 ios 中 最近任务视图的名称 需要在ios/runner/info.plist 文件中，CFBunderDisplayName 或 文件中，CFBunderName 配置
      title: "Flutter demo",
      theme: ThemeData(
          primaryColor: Color(0xFF42A5F5), // 配置应用程序的主背景颜色
          accentColor: Colors.yellow, // 配置
          brightness: Brightness.light, // 配置应用程序的亮色 暗色 dark
          primarySwatch: Colors
              .green, // 配置 导航栏（primaryColor 优先） 和 floatingActionButton 背景颜色
          // 配置appbar显示的样式
          appBarTheme: AppBarTheme(
              // 背景颜色
              color: Colors.deepPurple,
              // 阴影高度
              elevation: 10.0,
              // 图标 的配置
              iconTheme:
                  IconThemeData(color: Colors.yellow, size: 33.0, opacity: 0.3),
              // 右侧图标的配置
              actionsIconTheme:
                  IconThemeData(color: Colors.red, size: 28.0, opacity: 0.3)),
          //配置 应用程序icon 的样式
          iconTheme:
              IconThemeData(color: Colors.orange, size: 22.0, opacity: 0.3),
          primaryIconTheme:
              IconThemeData(color: Colors.black, size: 22.0, opacity: 0.3),
          buttonTheme: ButtonThemeData(
            textTheme: ButtonTextTheme.normal,
            height: 44.0,
            minWidth: 60.0,
            highlightColor: Colors.deepPurple,
            disabledColor: Colors.grey,
            buttonColor: Colors.green,
            splashColor: Colors.yellow,
            hoverColor: Colors.blue,
            focusColor: Colors.red,
          )),

      // 路由配置的三种方式
      // 第一种
      // home: FirstPage(),
      // 第二种
      // routes: {"/": (BuildContext context) => FirstPage()},
      // 第三种
      initialRoute: '/first',
      routes: {
        "/first": (BuildContext context) => FirstPage(),
        "/second": (BuildContext context) => SecondPage()
      },
      // 404 页面 机制
      onGenerateRoute: (RouteSettings settings) {
        return new MaterialPageRoute(
            builder: (BuildContext context) => ErrorPage());
      },
      // 路由监听机制
      navigatorObservers: <NavigatorObserver>[MyNavigatorObservers()],
    ));
